class MobilePhone:
    def __init__(self, brand, model, price, memory):
        self.brand = brand
        self.model = model
        self.__price = price  # 私有属性
        self.memory = memory

    def get_brand(self):
        return self.brand

    def get_model(self):
        return self.model

    def get_price(self):
        return self.__price

    def get_memory(self):
        return self.memory

    def set_price(self, new_price):
        if new_price > 0:
            self.__price = new_price
        else:
            print("价格不能小于等于 0")


phone = MobilePhone('Apple', 'iPhone14', 6999, '128GB')
print("品牌:", phone.get_brand())
print("型号:", phone.get_model())
print("价格:", phone.get_price())
print("内存容量:", phone.get_memory())


phone.set_price(5999)
print("新价格:", phone.get_price())

phone.set_price(-100)
